Crate codes_agency
source ·Expand description
This package provides a common code representing standards agencies.
The two core types, Agency and Standard work together to provide reporting capabilities to other codes project packages. Specifically a package that provides types corresponding to a standard definition can have an instance of the Standard struct that describes the standard. This in turn references the Agency that controls the standard.
use codes_agency::{Agency, Standard};
// Taken from codes_iso_4217
pub const ISO_4217: Standard = Standard::new_with_long_ref(
Agency::ISO,
"4217",
"ISO 4217:2015",
"Currency codes",
"https://www.iso.org/iso-4217-currency-codes.html",
);
assert_eq!(ISO_4217.agency().to_string(), String::from("ISO"));
assert_eq!(ISO_4217.short_ref(), "4217");
assert_eq!(ISO_4217.long_ref(), Some(&"ISO 4217:2015"));
assert_eq!(ISO_4217.title(), "Currency codes");
assert_eq!(ISO_4217.url(), "https://www.iso.org/iso-4217-currency-codes.html");
Macros
Structs
This structure allows for the description of a specific standard, or specification,
issued by a well-known standards agency. Note that different versions of a standard
should be different instances with at least different long references.
Enums
This enumeration allows for the identification of well-known standards agencies. This is
useful in documenting crates that implement such standards.
An error associated with handling String representations of the Agency short name.